/*
 * DataRepository   2016-11-23
 *
 * Copyright(c) 2016 moke co.ltd. All right reserved
 */

package com.ptmall.app.net.api;


import android.text.TextUtils;
import android.util.Log;

import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.google.gson.reflect.TypeToken;
import com.ptmall.app.App;
import com.ptmall.app.bean.AddressBean;
import com.ptmall.app.bean.CategoryBean;
import com.ptmall.app.bean.CollectionBean;
import com.ptmall.app.bean.ConfirmOrderInfoBean;
import com.ptmall.app.bean.CouponBean;
import com.ptmall.app.bean.FyBean;
import com.ptmall.app.bean.GGBean;
import com.ptmall.app.bean.GoodDetilBean;
import com.ptmall.app.bean.HomePageArea;
import com.ptmall.app.bean.LogBean;
import com.ptmall.app.bean.MessageBean;
import com.ptmall.app.bean.OrderBean;
import com.ptmall.app.bean.OrderDetilBean;
import com.ptmall.app.bean.PageData;
import com.ptmall.app.bean.PayBean;
import com.ptmall.app.bean.ProductBean;
import com.ptmall.app.bean.RechargeWalletBean;
import com.ptmall.app.bean.SettingBean;
import com.ptmall.app.bean.ShareCouponBean;
import com.ptmall.app.bean.ShopCarBean;
import com.ptmall.app.bean.SpreadBean;
import com.ptmall.app.bean.StyleBean;
import com.ptmall.app.bean.TimeShopBean;
import com.ptmall.app.bean.WalletRechargeBean;
import com.ptmall.app.bean.ZtBean;
import com.ptmall.app.bean.model.HomePageIndex;
import com.ptmall.app.bean.model.db.Account;
import com.ptmall.app.net.HttpMethods;
import com.ptmall.app.net.base.ApiBaseData;
import com.ptmall.app.net.base.ApiNetResponse;
import com.ptmall.app.net.base.BaseBean;
import com.ptmall.app.net.base.HttpDataRepositoryBase;
import com.ptmall.app.net.base.Request;
import com.ptmall.app.net.base.Result;
import com.xfly.app.bean.BankBean;
import com.xfly.app.bean.CarBean;
import com.xfly.app.bean.DetilBean;
import com.xfly.app.bean.FxBean;
import com.xfly.app.bean.HdBean;
import com.xfly.app.bean.HtBean;
import com.xfly.app.bean.ImgBean;
import com.xfly.app.bean.KcBean;
import com.xfly.app.bean.KcggBean;
import com.xfly.app.bean.LbBean;
import com.xfly.app.bean.MsBean;
import com.xfly.app.bean.MzBean;
import com.xfly.app.bean.QbBean;
import com.xfly.app.bean.ShBean;
import com.xfly.app.bean.SjBean;
import com.xfly.app.bean.TeamBean;
import com.xfly.app.bean.UserBean;
import com.xfly.app.bean.WlBean;
import com.xfly.app.bean.XsBean;
import com.xfly.app.bean.YfBean;
import com.xfly.app.bean.YhqBean;
import com.xfly.app.bean.ZpBean;

import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

import io.reactivex.Observable;
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
import okhttp3.MediaType;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

import static com.ptmall.app.net.HttpMethods.KEY_ID;

/**
 * class descrition here
 *
 * @version 1.0.0
 * @authour zyy
 * @since 2016-11-23
 */
public class ApiDataRepository extends HttpDataRepositoryBase {


    private static ApiDataRepository mDataRepository = null;
    private final String TAG = "xucc";

    public ApiService mChainService = mRetrofit.create(ApiService.class);

    private ApiDataRepository() {
    }

    public static ApiDataRepository getInstance() {
        if (null == mDataRepository) {
            synchronized (ApiDataRepository.class) {
                if (null == mDataRepository) {
                    mDataRepository = new ApiDataRepository();
                }
            }
        }
        return mDataRepository;
    }

    public Observable getObservable(Map params, String method) {
        if (null == params) {
            params = new HashMap<String, String>();
        }
        return mChainService.executePost(method, mHttpMethods.getRequest(params).map);
    }



    /**
     *
     *
     *
     *
     * */
    public Disposable xfLogin(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.XFLOGIN), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable wl(Map params, ApiNetResponse<WlBean> netResponse) {
        return toSubscribe(getObservable(params, ApiService.CKWL), netResponse, new TypeToken<WlBean>() {
        });
    }

    public Disposable myInfo(Map params, ApiNetResponse<UserBean> netResponse) {
        return toSubscribe(getObservable(params, ApiService.MYINFO), netResponse, new TypeToken<UserBean>() {
        });
    }

    public Disposable setinfo(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.SETINFO), netResponse, new TypeToken<Object>() {
        });
    }
    public Disposable subht(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.SUBHT), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable getAddress(Map params, ApiNetResponse<List<AddressBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.ADDRESS), netResponse, new TypeToken<List<AddressBean>>() {
        });
    }
    public Disposable getAddressDetil(Map params, ApiNetResponse<AddressBean> netResponse) {
        return toSubscribe(getObservable(params, ApiService.ADDRESSDETIL), netResponse, new TypeToken<AddressBean>() {
        });
    }


    public Disposable repass(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.REPASS), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable subgood(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.UPGOOD), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable tj(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.TJ), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable fk(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.FK), netResponse, new TypeToken<Object>() {
        });
    }


    public Disposable qblist(Map params, ApiNetResponse<List<QbBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.QBLIST), netResponse, new TypeToken<List<QbBean>>() {
        });
    }

    public Disposable addbank(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.ADDBANK), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable getxs(Map params, ApiNetResponse<XsBean> netResponse) {
        return toSubscribe(getObservable(params, ApiService.GETXS), netResponse, new TypeToken<XsBean>() {
        });
    }

    public Disposable banklist(Map params, ApiNetResponse<List<BankBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.BANKLIST), netResponse, new TypeToken<List<BankBean>>() {
        });
    }
    public Disposable banklist2(Map params, ApiNetResponse<List<BankBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.BANKLIST2), netResponse, new TypeToken<List<BankBean>>() {
        });
    }

    public Disposable delbank(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.DELBANK), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable tx(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.TX), netResponse, new TypeToken<Object>() {
        });
    }


    public Disposable kclist(Map params, ApiNetResponse<List<KcBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.KCLIST), netResponse, new TypeToken<List<KcBean>>() {
        });
    }

    public Disposable sjxj(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.SJXJ), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable getZpList(Map params, ApiNetResponse<List<ZpBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.GETZPLIST), netResponse, new TypeToken<List<ZpBean>>() {
        });
    }

    public Disposable getmz(Map params, ApiNetResponse<MzBean> netResponse) {
        return toSubscribe(getObservable(params, ApiService.MZGETSET), netResponse, new TypeToken<MzBean>() {
        });
    }

    public Disposable lblist(Map params, ApiNetResponse<List<LbBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.LBLIST), netResponse, new TypeToken<List<LbBean>>() {
        });
    }

    public Disposable getyf(Map params, ApiNetResponse<List<YfBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.GETYF), netResponse, new TypeToken<List<YfBean>>() {
        });
    }

    public Disposable getTeamList(Map params, ApiNetResponse<List<TeamBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.TEAMLIST), netResponse, new TypeToken<List<TeamBean>>() {
        });
    }


    public Disposable getsjList(Map params, ApiNetResponse<List<SjBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.SJLIST), netResponse, new TypeToken<List<SjBean>>() {
        });
    }
    public Disposable getsh(Map params, ApiNetResponse<ShBean> netResponse) {
        return toSubscribe(getObservable(params, ApiService.SHXQ), netResponse, new TypeToken<ShBean>() {
        });
    }
    public Disposable clsj(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.CLSJ), netResponse, new TypeToken<Object>() {
        });
    }
    public Disposable txwl(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.TXWL), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable sxj(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.SXJ), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable getKcGG(Map params, ApiNetResponse<List<KcggBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.GG), netResponse, new TypeToken<List<KcggBean>>() {
        });
    }
    public Disposable setGG(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.SETGG), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable bjaddlb(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.ADDLB), netResponse, new TypeToken<Object>() {
        });
    }
    public Disposable dellb(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.DELLB), netResponse, new TypeToken<Object>() {
        });
    }
    public Disposable addyhq(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.ADDYHQ), netResponse, new TypeToken<Object>() {
        });
    }
    public Disposable addms(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.ADDMS), netResponse, new TypeToken<Object>() {
        });
    }
    public Disposable setyhqNum(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.YHQNUM), netResponse, new TypeToken<Object>() {
        });
    }
    public Disposable delyhq(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.DELYHQ), netResponse, new TypeToken<Object>() {
        });
    }
    public Disposable mzset(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.MZSET), netResponse, new TypeToken<Object>() {
        });
    }
    public Disposable gethd(Map params, ApiNetResponse<HdBean> netResponse) {
        return toSubscribe(getObservable(params, ApiService.GETHD), netResponse, new TypeToken<HdBean>() {
        });
    }
    public Disposable setHd(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.SETHD), netResponse, new TypeToken<Object>() {
        });
    }
    public Disposable getMz(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.GETMZ), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable getyhqlist(Map params, ApiNetResponse<List<YhqBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.YHQLIST), netResponse, new TypeToken<List<YhqBean>>() {
        });
    }
    public Disposable getmslist(Map params, ApiNetResponse<MsBean> netResponse) {
        return toSubscribe(getObservable(params, ApiService.MSLIST), netResponse, new TypeToken<MsBean>() {
        });
    }
    public Disposable yfset(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.YFSET), netResponse, new TypeToken<Object>() {
        });
    }
    public Disposable add(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.CARADD), netResponse, new TypeToken<Object>() {
        });
    }
    public Disposable jian(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.JIAN), netResponse, new TypeToken<Object>() {
        });
    }
    public Disposable shzt(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.SHZT), netResponse, new TypeToken<Object>() {
        });
    }
    public Disposable getfx(Map params, ApiNetResponse<FxBean> netResponse) {
        return toSubscribe(getObservable(params, ApiService.GETFX), netResponse, new TypeToken<FxBean>() {
        });
    }
    public Disposable sj(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.SJ), netResponse, new TypeToken<Object>() {
        });
    }
    public Disposable clist(Map params, ApiNetResponse<CarBean> netResponse) {
        return toSubscribe(getObservable(params, ApiService.CLIST), netResponse, new TypeToken<CarBean>() {
        });
    }
    public Disposable GoodDetil(Map params, ApiNetResponse<DetilBean> netResponse) {
        return toSubscribe(getObservable(params, ApiService.GOODDETILS), netResponse, new TypeToken<DetilBean>() {
        });
    }

    public Disposable goodlist(Map params, ApiNetResponse<List<KcBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.GOODLIST), netResponse, new TypeToken<List<KcBean>>() {
        });
    }
    public Disposable htlist(Map params, ApiNetResponse<List<HtBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.HTLIST), netResponse, new TypeToken<List<HtBean>>() {
        });
    }

    public Disposable getorderinfo(Map params, ApiNetResponse<com.xfly.app.bean.OrderBean> netResponse) {
        return toSubscribe(getObservable(params, ApiService.XFORDER), netResponse, new TypeToken<com.xfly.app.bean.OrderBean>() {
        });
    }































    public void uploadFile(String params, Consumer<Result<String>> consumer) {
        toSubscribe(uploadFile(params), consumer);
    }

    public Observable<Result<String>> uploadFile(Map params) {


        //排序用map
        TreeMap<String, RequestBody> map;
        if (null != params) {
            map = new TreeMap(params);
        } else {
            map = new TreeMap<>();
        }

        for (Map.Entry<String, RequestBody> entry : map.entrySet()) {
            map.put(entry.getKey(), getBody(entry.getValue()));
        }

        Observable<Result<String>> observable = mChainService.alter(map);
        return observable;
    }

    public RequestBody getBody(/*String key,*/ Object o) {
        if (o instanceof String) {
            //params.put(key, body);
            return RequestBody.create(MediaType.parse("text/plain"), (String) o);
        } else if (o instanceof File) {
            //params.put(key + "\"; filename=\"" + ((File) o).getName() + "", body);
            return RequestBody.create(MediaType.parse("image/*"), (File) o);
        }
        return null;
    }

    public Observable<Result<String>> uploadFile(String filePath) {

        File file = new File(filePath);
        RequestBody requestFile = RequestBody.create(MediaType.parse("multipart/form-data"), file);
        MultipartBody.Part filePart = MultipartBody.Part.createFormData("file", "image", requestFile);


        Map<String, RequestBody> map = new HashMap<>();

//        for (Map.Entry<String, Object> entry : request.map.entrySet()) {
//            RequestBody arg = RequestBody.create(MediaType.parse("text/plain"), entry.getValue().toString());
//            map.put(entry.getKey(), arg);
//        }
//        map.put("file",filePart);

//        RequestBody sign = RequestBody.create(MediaType.parse("text/plain"), request.sign);
//        RequestBody arg = RequestBody.create(MediaType.parse("text/plain"), request.arg);

//        Observable<Result<UploadResult>> observable = mDownUploadService.uploadFile(map,filePart);
        Observable<Result<String>> observable = mChainService.uploadFile(filePart);
        return observable;
    }

    public Observable getObservable(BaseBean params, String method) {
        if (null == params) {
            params = new BaseBean();
        }
        return mChainService.executePost(method, mHttpMethods.getRequest(params).map);
    }

    public Disposable getGsonDemo(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ""), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable register(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.REGITSER), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable homePageAreaList(Map params, ApiNetResponse<PageData<HomePageArea>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.HOMEPAGEAREALIST), netResponse, new TypeToken<PageData<HomePageArea>>() {
        });
    }
    public Disposable moreXq(Map params, ApiNetResponse<PageData<HomePageArea>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.MOREXIAOQU), netResponse, new TypeToken<PageData<HomePageArea>>() {
        });
    }

    public Disposable login(Map params, ApiNetResponse<Account> netResponse) {
        return toSubscribe(getObservable(params, ApiService.LOGIN), netResponse, new TypeToken<Account>() {
        });
    }

    public Disposable wxlogin(Map params, ApiNetResponse<Account> netResponse) {
        return toSubscribe(getObservable(params, ApiService.WXLOGIN), netResponse, new TypeToken<Account>() {
        });
    }
    public Disposable getGG(Map params, ApiNetResponse<GGBean> netResponse) {
        return toSubscribe(getObservable(params, ApiService.GGDETIL), netResponse, new TypeToken<GGBean>() {
        });
    }
    public Disposable getImg(Map params, ApiNetResponse<List<ImgBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.STARTIMG), netResponse, new TypeToken<List<ImgBean>>() {
        });
    }
    public Disposable wxGetInfo(String url,Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, url), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable getIndex(Map params, ApiNetResponse<HomePageIndex> netResponse) {
        return toSubscribe(getObservable(params, ApiService.HOMEPAGEINDEX), netResponse, new TypeToken<HomePageIndex>() {
        });
    }

    public Disposable getWalletList(Map params, ApiNetResponse<PageData<WalletRechargeBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.WALLETRECHARGELIST), netResponse, new TypeToken<PageData<WalletRechargeBean>>() {
        });
    }

    public Disposable getUserInfo(Map params, ApiNetResponse<Account> netResponse) {
        return toSubscribe(getObservable(params, ApiService.MEINFO), netResponse, new TypeToken<Account>() {
        });
    }

    public Disposable putRechargeWallet(Map params, ApiNetResponse<RechargeWalletBean> netResponse) {
        return toSubscribe(getObservable(params, ApiService.WALLETRECHARGE), netResponse, new TypeToken<RechargeWalletBean>() {
        });
    }


    public Disposable getMsgList(Map params, ApiNetResponse<PageData<MessageBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.MESSAGELIST), netResponse, new TypeToken<PageData<MessageBean>>() {
        });
    }

    public Disposable getMsgUrl(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.MESSAGEURL), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable getCollectionList(Map params, ApiNetResponse<PageData<CollectionBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.COLLECTIONList), netResponse, new TypeToken<PageData<CollectionBean>>() {
        });
    }

    public Disposable getOrderNotice(Map params, ApiNetResponse<PageData<LogBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.ORDERNOTICE), netResponse, new TypeToken<PageData<LogBean>>() {
        });
    }
    public Disposable getFyWaitList(Map params, ApiNetResponse<List<FyBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.GETFYWAIT), netResponse, new TypeToken<List<FyBean>>() {
        });
    }
    public Disposable getFyList(Map params, ApiNetResponse<List<FyBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.GETFYLIST), netResponse, new TypeToken<List<FyBean>>() {
        });
    }

    public Disposable getAddressList(Map params, ApiNetResponse<List<AddressBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.ADDRESSLIST), netResponse, new TypeToken<List<AddressBean>>() {
        });
    }

    public Disposable addAddress(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.ADDADDRESS), netResponse, new TypeToken<Object>() {
        });
    }
    public Disposable ffyj(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.FFYJPUT), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable editAddress(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.EDITADDRESS), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable delAddress(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.DELADDRESS), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable applyshop(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.APPLYSHOP), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable getCategory(Map params, ApiNetResponse<List<CategoryBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.GETCATELIST), netResponse, new TypeToken<List<CategoryBean>>() {
        });
    }

    public Disposable getOrderList(Map params, ApiNetResponse<List<OrderBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.ORDERLIST), netResponse, new TypeToken<List<OrderBean>>() {
        });
    }

    public Disposable getShopCarList(Map params, ApiNetResponse<PageData<ShopCarBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.SHOPCARLIST), netResponse, new TypeToken<PageData<ShopCarBean>>() {
        });
    }

    public Disposable getOrderDetil(Map params, ApiNetResponse<OrderDetilBean> netResponse) {
        return toSubscribe(getObservable(params, ApiService.ORDERDETIL), netResponse, new TypeToken<OrderDetilBean>() {
        });
    }
    public Disposable getTkDetil(Map params, ApiNetResponse<OrderDetilBean> netResponse) {
        return toSubscribe(getObservable(params, ApiService.TKDETIL), netResponse, new TypeToken<OrderDetilBean>() {
        });
    }

    public Disposable resetPass(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.RESETPASS), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable seedlogin(Map params, ApiNetResponse<Account> netResponse) {
        return toSubscribe(getObservable(params, ApiService.SEEDLOGIN), netResponse, new TypeToken<Account>() {
        });
    }
    public Disposable wxbdLogin(Map params, ApiNetResponse<Account> netResponse) {
        return toSubscribe(getObservable(params, ApiService.WXBDLOGIN), netResponse, new TypeToken<Account>() {
        });
    }

    public Disposable shopCarAdd(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.SHOPCARADDM), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable settingPass(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.SETTINGPAYPASS), netResponse, new TypeToken<Object>() {
        });
    }


    public Disposable delShopCarGood(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.DELSHOPCARGOOD), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable addShopCar(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.GOODADDCAR), netResponse, new TypeToken<Object>() {
        });
    }


    public Disposable getGoodList(Map params, ApiNetResponse<PageData<ProductBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.GOODLISt), netResponse, new TypeToken<PageData<ProductBean>>() {
        });
    }

    public Disposable seachlist(Map params, ApiNetResponse<PageData<ProductBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.SEACHLIST), netResponse, new TypeToken<PageData<ProductBean>>() {
        });
    }

    public Disposable cnxh(Map params, ApiNetResponse<PageData<ProductBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.CNXH), netResponse, new TypeToken<PageData<ProductBean>>() {
        });
    }

    public Disposable getSeachGood(Map params, ApiNetResponse<PageData<ProductBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.SEACHGOOD), netResponse, new TypeToken<PageData<ProductBean>>() {
        });
    }

    public Disposable confrimOrder(Map params, ApiNetResponse<PayBean> netResponse) {
        return toSubscribe(getObservable(params, ApiService.CONFRIMORDER), netResponse, new TypeToken<PayBean>() {
        });
    }

    public Disposable orderIdPay(Map params, ApiNetResponse<PayBean> netResponse) {
        return toSubscribe(getObservable(params, ApiService.ORDERIDPAY), netResponse, new TypeToken<PayBean>() {
        });
    }

    public Disposable getGooddetil(Map params, ApiNetResponse<GoodDetilBean> netResponse) {
        return toSubscribe(getObservable(params, ApiService.GOODDETIL), netResponse, new TypeToken<GoodDetilBean>() {
        });
    }

    public Disposable getstyle2(Map params, ApiNetResponse<List<CategoryBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.GETSTYLE2), netResponse, new TypeToken<List<CategoryBean>>() {
        });
    }

    public Disposable orderCancel(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.ORDERCANCEL), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable orderDel(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.ORDERDEL), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable qxtk(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.ORDERQXTK), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable addCollection(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.ADDCOLLECTION), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable delCollection(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.DELCOLLECTION), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable conSh(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.ENTERORDER), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable nickNameEdit(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.NICKNAMEEDIT), netResponse, new TypeToken<Object>() {
        });
    }

    public Disposable msList(Map params, ApiNetResponse<TimeShopBean> netResponse) {
        return toSubscribe(getObservable(params, ApiService.MIAOSHALIST), netResponse, new TypeToken<TimeShopBean>() {
        });
    }

    public Disposable getCouponList(Map params, ApiNetResponse<PageData<CouponBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.COUPONLIST), netResponse, new TypeToken<PageData<CouponBean>>() {
        });
    }

    public Disposable getZtData(Map params, ApiNetResponse<ZtBean> netResponse) {
        return toSubscribe(getObservable(params, ApiService.ZTDATA), netResponse, new TypeToken<ZtBean>() {
        });
    }
    public Disposable ssTk(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.TUIKUANSHENQING), netResponse, new TypeToken<Object>() {
        });
    }
    public Disposable getSpread(Map params, ApiNetResponse<SpreadBean> netResponse) {
        return toSubscribe(getObservable(params, ApiService.MYSPEAD), netResponse, new TypeToken<SpreadBean>() {
        });
    }
    public Disposable getQuan(Map params, ApiNetResponse<List<ShareCouponBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.QUANLIST), netResponse, new TypeToken<List<ShareCouponBean>>() {
        });
    }
    public Disposable getCdList(Map params, ApiNetResponse<PageData<ProductBean>> netResponse) {
        return toSubscribe(getObservable(params, ApiService.COUDAN), netResponse, new TypeToken<PageData<ProductBean>>() {
        });
    }
    public Disposable lq(Map params, ApiNetResponse<Object> netResponse) {
        return toSubscribe(getObservable(params, ApiService.GETQUAN), netResponse, new TypeToken<Object>() {
        });
    }
    public Disposable getShopSetting(Map params, ApiNetResponse<SettingBean> netResponse) {
        return toSubscribe(getObservable(params, ApiService.SHOPSETTING), netResponse, new TypeToken<SettingBean>() {
        });
    }
    public Disposable getConfirmDetil(Map params, ApiNetResponse<ConfirmOrderInfoBean> netResponse) {
        return toSubscribe(getObservable(params, ApiService.CONFIRMDETIL), netResponse, new TypeToken<ConfirmOrderInfoBean>() {
        });
    }
}
